package demo1;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println("========");
        System.out.println(binaryTree.size(root));
        System.out.println(binaryTree.size2(root));
        System.out.println("叶子节点数");
        System.out.println(binaryTree.leafNode(root));
        System.out.println(binaryTree.leafNode2(root));
        System.out.println("第K层的节点数");
        System.out.println(binaryTree.getKLevelNodeCount(root, 3));
        System.out.println("树的高度");
        System.out.println(binaryTree.getHeight(root));

    }
}
